var express = require('express'),
    swig = require('swig-templates'),
    request = require('request'),
    router = express.Router(),
    common = require('../base/common.js'),
    loginAuth = require('../base/login-auth.js');
// router.get('/add-address',function(req, res,next) {
//     res.render('my-haier/account_manage/address_manage/add_address');
// });
router.get('/address-manage',function(req, res,next) {
    loginAuth.loginAuth(req,res,function (account) {
        request.post({
            url: config.resourcePath.apiRoot + "/index.php?m=BookClean&a=addressList",
            formData: {
                u_id: req.cookies.u_id?req.cookies.u_id:''
            }
        }, function (error, response, body) {
            var thatData={};
            try {
                var result = JSON.parse(body);
                // console.log(result);
                thatData.thatData=result;
                res.render('my-haier/account_manage/address_manage/address_manage', thatData);
            } catch (e) {
            }
        });
    });
});
module.exports = router;